import http from "@/api";
import { ResPage } from "../interface";
import { Tag } from "../interface/tag";

/**
 * @name 标签模块
 */

export const getTagListApi = (pageNum: number, pageSize: number, wrapper?: Partial<Tag>) => {
	return http.post<ResPage<Tag>>(`/blog/tag/getTagList/${pageNum}/${pageSize}`, { wrapper });
};

export const addTagApi = (tag: Tag) => {
	return http.post<string>("/blog/tag/create", tag);
};

export const updateTagApi = (tag: Tag) => {
	return http.post<string>("/blog/tag/update", tag);
};

export const deleteTagApi = (id: number) => {
	return http.delete<string>(`/blog/tag/delete/${id}`);
};
